package com.tongji.seller.command
{
	import com.tongji.seller.events.GetStoreUserSceneEvent;
	import com.tongji.seller.model.StoreSceneModel;
	import com.tongji.seller.model.UserSceneModel;
	import com.tongji.seller.service.StoreSceneService;
	import com.tongji.seller.service.UserSceneService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author chenzhongyuan
	 * 2011-12-6
	 */
	
	public class GetStoreUserSceneCmd extends Command
	{	
		[Inject]
		public var service:UserSceneService;
		
		[Inject]
		public var model:StoreSceneModel;
		
		[Inject]
		public var event:GetStoreUserSceneEvent;
		
		public function GetStoreUserSceneCmd()
		{
			super();
		}
		
		override public function execute():void
		{
			switch(event.type)
			{
				case GetStoreUserSceneEvent.GET_STORE_USER_SCENE:
					service.getStoreUserScene(event.userId, event.page_no, event.pageSize);
					break;
				case GetStoreUserSceneEvent.UPDATE_STORE_USER_SCENE:
					model.updateMatchScenes(event.scene);
					break;
				default:
					break;
			}
		}
	}
}